/*
 * mainWindow.cpp
 *
 *  Created on: 2011-8-17
 *      Author: fufan
 */
#include "mainWindow.h"
#include "agent.h"
#include "ui_AboutQSnmp.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
		setupUi(this);

		connect(this->actionExit, SIGNAL(triggered(bool)), this, SLOT(close()));
		connect(this->actionAgent, SIGNAL(triggered(bool)), this, SLOT(showAgent()));
		connect(this->actionQSnmp, SIGNAL(triggered(bool)), this, SLOT(showQSnmp()));
}

void MainWindow::showAgent()
{
		QString agentName = this->agentBox->currentText();
		Agent *agentDialog = new Agent(agentName, this->agentBox,this);
		agentDialog->show();
}

void MainWindow::showQSnmp()
{
		QDialog *aboutDialog = new QDialog(this);
		Ui::AboutDialog *aboutQSnmp = new Ui::AboutDialog();
		aboutQSnmp->setupUi(aboutDialog);
		aboutDialog->show();
}
